package cn.zcscloud.mall.mbg.mapper;

import cn.zcscloud.mall.mbg.model.PmsProductAttribute;
import cn.zcscloud.mall.mbg.model.PmsProductAttributeExample;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface PmsProductAttributeMapper extends BaseMapper<PmsProductAttribute> {
    long countByExample(PmsProductAttributeExample example);

    int deleteByExample(PmsProductAttributeExample example);

    int deleteByPrimaryKey(Long id);

    int insert(PmsProductAttribute record);

    int insertSelective(PmsProductAttribute record);

    List<PmsProductAttribute> selectByExample(PmsProductAttributeExample example);

    PmsProductAttribute selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") PmsProductAttribute record, @Param("example") PmsProductAttributeExample example);

    int updateByExample(@Param("record") PmsProductAttribute record, @Param("example") PmsProductAttributeExample example);

    int updateByPrimaryKeySelective(PmsProductAttribute record);

    int updateByPrimaryKey(PmsProductAttribute record);

    @Select("select count(id) from pms_product_attribute where product_attribute_category_id = #{attributeCategoryId} and type =0")
    Integer selectByIdAttributeCountNum(Long attributeCategoryId);


    @Select("select count(id) from pms_product_attribute where product_attribute_category_id =#{attributeCategoryId} and type = 1")
    Integer selectByIdParamCountNum(Long attributeCategoryId);
}